1. Field of the Invention
The present invention relates to communication apparatuses and methods for controlling the same, and storage media.
2. Description of the Related Art
Image forming apparatuses are typically provided with an authentication function for control of whether or not to permit a user to use the apparatus. Some of such authentication functions have in recent years utilized a radio-frequency identification (RFID) tag. For example, in the case of an image forming apparatus equipped with a reader/writer for reading information from an RFID tag, when a user puts an RFID tag on or near the reader/writer, information in the RFID tag is read by the reader/writer, whereby an authentication function using RFID can be performed.
Also, in recent years, Near Field Communication (NFC), which is a short-range wireless communication technique compatible with RFID, has started to be implemented in mobile terminals, such as a smartphone, a tablet computer, etc. The NFC standards define three functions which are a reader/writer function, a card emulation function, and an inter device communication (peer-to-peer (P2P)) function. The reader/writer function is a function of reading and writing data from and to an NFC-compliant device, and is similar to the above-described reader/writer of RFID. The card emulation function is a function similar to the above-described operation of an RFID tag. The peer-to-peer function is a function of exchanging data between NFC-compliant devices. A mobile terminal having the NFC functions has a reader/writer implemented therein, which allows the mobile terminal to read and write data from and to an RFID card or an NFC card. It is not necessary to previously supply power to RFID cards, because, when the RFID card communicates with a reader/writer, power is supplied from the reader/writer to the RFID card via radio waves to allow the RFID card to operate.
On the other hand, if an image forming apparatus has the NFC functions, the image forming apparatus can not only perform an authentication function using the reader/writer function as described above, but also communicate with a mobile terminal having the NFC functions using the card emulation function. As a result, the mobile terminal can display information about the image forming apparatus, such as information about consumables (e.g., the amount of paper remaining on a paper feed tray) in the image forming apparatus, information about the state of a print job processed in the image forming apparatus, etc. With such a display technique, for example, even when an image forming apparatus is equipped with a small display unit or is not equipped with any display unit, information about the image forming apparatus can be displayed using a mobile terminal having a larger display unit. In addition, for example, when an error occurs in an image forming apparatus, the details of the error and instructions for troubleshooting the error can be displayed on the display unit of a mobile terminal to prompt the user to troubleshoot the error.
Thus, in an image forming apparatus having the NFC functions, the reader/writer function is used when an authentication function is performed, and the card emulation function is used when information is provided to a mobile terminal. Therefore, the image forming apparatus needs to switch the operation mode between a reader/writer mode in which the reader/writer function is used and a card emulation mode in which the card emulation function is used, depending on the situation in which the image forming apparatus operates.
For example, Japanese Patent Laid-Open No. 2011-60046 proposes a technique of switching the communication mode of an NFC device between an operation mode in which the NFC device functions as a reader/writer and an operation mode in which the NFC device functions as an active tag, depending on the operation state of an information processing apparatus including the NFC device. Specifically, the NFC device is caused to operate in the active tag mode when the operation state of the information processing apparatus is the powered-off or power-saving state, and in the reader/writer mode when the operation state of the information processing apparatus is the normal power state. Thus, the operation state of the information processing apparatus in the above patent document corresponds to the state of power consumption by the information processing apparatus.
However, in the conventional technique of the above patent document, the operation mode of the NFC device is switched, depending only on the state of power consumption by the information processing apparatus, irrespective of whether or not an error occurs. If such a technique is applied to an image forming apparatus, then even when an error occurs in the image forming apparatus, the operation mode of the NFC device is not automatically switched. For example, when the NFC device is operating in the reader/writer mode while the image forming apparatus is in the normal operation state, then even if an error occurs in the image forming apparatus, information about the error cannot be displayed on a mobile terminal via NFC. In this case, it is necessary to switch the operation mode of the NFC device to the card emulation mode by the user's operation. In addition, when the NFC device is operating in the card emulation mode while the image forming apparatus is in the power-saving state, authentication information cannot be read from an NFC card, thus, authentication cannot be performed via NFC. Therefore, it is necessary to appropriately switch the operation mode of the NFC device without decreasing the user's convenience even if an error occurs in the image forming apparatus.